class Dog:

    """创建初始化方法"""
    def __init__(self, name, age):
        self.name = name
        self.age = age

    def sit(self):
        print(self.name.title() + " is now sitting.")

    def roll_over(self):
        print(self.name.title() + " rolled over!")


dog = Dog("willie", 8)
print("My dog's name is " + dog.name.title() + ".")
print("My dog is " + str(dog.age) + " years old.")
dog.sit()
dog.roll_over()